//
// Created by infore on 2024/4/19.
//
#include "iostream"
using namespace std;

class Singleton {
private:
    static Singleton *instance;
    string _value;
    Singleton (const string val): _value(val) {}
public:
    static Singleton *getInstance(const string val);
};

Singleton *Singleton::instance = nullptr;
Singleton *Singleton::getInstance(const string val) {
    if (instance == nullptr) {
        instance = new Singleton(val);
    }
    return instance;
}